<?php
defined('_JEXEC') or die( 'Restricted access' );

jimport( 'joomla.application.component.view');

class igprofileViewAdd_edit_profile extends JView
{
	function display($tpl = null)
	{
		$db	=& JFactory::getDBO();
		$profile =& $this->get('Data');

		if(empty($profile->id))
		{
			JToolBarHelper::title( JText::_('NEW PROFILE') );
		}
		else
		{
			JToolBarHelper::title( JText::_('EDIT PROFILE').' - '.$profile->name );
			JToolBarHelper::apply();
		}

		JToolBarHelper::save();
		JToolBarHelper::cancel();


		//make the html form elements
		$lists = array();

		$lists['show_search'] = JHTML::_('select.booleanlist',  'show_search', 'class="inputbox"', $profile->show_search );

		$lists['show_cat_title'] = JHTML::_('select.booleanlist',  'show_cat_title', 'class="inputbox"', $profile->show_cat_title );

		$lists['published'] = JHTML::_('select.booleanlist',  'published', 'class="inputbox"', $profile->published );
		
		$refresh_mode = array();
		$refresh_mode[] = JHTML::_( 'select.option', 'javascript', JText::_( 'JAVASCRIPT' ) );
		$refresh_mode[] = JHTML::_( 'select.option', 'hash', JText::_( 'JAVASCRIPT WITH HASH' ) );
		$lists['refresh_mode'] = JHTML::_('select.radiolist', $refresh_mode, 'refresh_mode', 'class="inputbox" ', 'value', 'text', $profile->refresh_mode, 'refresh_mode' );
		
		$lists['round_large'] = JHTML::_('select.booleanlist',  'round_large', 'class="inputbox"', $profile->round_large );
		$lists['round_thumb'] = JHTML::_('select.booleanlist',  'round_thumb', 'class="inputbox"', $profile->round_thumb );
		$lists['round_menu'] = JHTML::_('select.booleanlist',  'round_menu', 'class="inputbox"', $profile->round_menu );

		//menu tab
		$lists['crop_menu'] = JHTML::_('select.booleanlist', 'crop_menu', 'class="inputbox"', $profile->crop_menu );
		
		$lists['menu_image_defaults'] = JHTML::_('select.booleanlist', 'menu_image_defaults', 'class="inputbox"', $profile->menu_image_defaults );
		
		$lists['menu_pagination'] = JHTML::_('select.booleanlist', 'menu_pagination', 'class="inputbox"', $profile->menu_pagination );
		
		$menu_pagination_amount = array();
		$menu_pagination_amount[5] = JHTML::_( 'select.option', 5, 5 );
		$menu_pagination_amount[10] = JHTML::_( 'select.option', 10, 10 );
		$menu_pagination_amount[15] = JHTML::_( 'select.option', 15, 15 );
		$menu_pagination_amount[20] = JHTML::_( 'select.option', 20, 20 );
		$menu_pagination_amount[25] = JHTML::_( 'select.option', 25, 25 );
		$menu_pagination_amount[30] = JHTML::_( 'select.option', 30, 30 );
		
		$lists['menu_pagination_amount'] = JHTML::_('select.genericlist', $menu_pagination_amount, 'menu_pagination_amount', 'class="inputbox" size="1"', 'value', 'text', $profile->menu_pagination_amount );

		//main image tab
		$lists['show_large_image'] = JHTML::_('select.booleanlist', 'show_large_image', 'class="inputbox"', $profile->show_large_image );

		$lists['crop_main'] = JHTML::_('select.booleanlist', 'crop_main', 'class="inputbox"', $profile->crop_main );

		$lists['fade_duration'] = JHTML::_('select.booleanlist', 'fade_duration', 'class="inputbox"', $profile->fade_duration );

		$lists['preload'] = JHTML::_('select.booleanlist', 'preload', 'class="inputbox"', $profile->preload );

		$lists['magnify'] = JHTML::_('select.booleanlist', 'magnify', 'class="inputbox"', $profile->magnify );

		$lists['watermark'] = JHTML::_('select.booleanlist', 'watermark', 'class="inputbox"', $profile->watermark );

		$watermark_position = array();
		$watermark_position[] = JHTML::_( 'select.option', 'left_top', JText::_( 'TOPLEFT' ) );
		$watermark_position[] = JHTML::_( 'select.option', 'center_top', JText::_( 'TOP' ) );
		$watermark_position[] = JHTML::_( 'select.option', 'right_top', JText::_( 'TOPRIGHT' ) );
		$watermark_position[] = JHTML::_( 'select.option', 'right_middle', JText::_( 'RIGHT' ) );
		$watermark_position[] = JHTML::_( 'select.option', 'right_bottom', JText::_( 'BOTTOMRIGHT' ) );
		$watermark_position[] = JHTML::_( 'select.option', 'center_bottom', JText::_( 'BOTTOM' ) );
		$watermark_position[] = JHTML::_( 'select.option', 'left_bottom', JText::_( 'BOTTOMLEFT' ) );
		$watermark_position[] = JHTML::_( 'select.option', 'left_middle', JText::_( 'LEFT' ) );
		$watermark_position[] = JHTML::_( 'select.option', 'center_middle', JText::_( 'CENTER' ) );

		$lists['watermark_position'] = JHTML::_('select.radiolist', $watermark_position, 'watermark_position', 'class="inputbox" size="1"', 'value', 'text', $profile->watermark_position, 'watermark_position' );

		$lists['remove_wm_image'] = JHTML::_('select.booleanlist',  'remove_wm_image', 'class="inputbox"', 0 );

		//thumbs tab
		$lists['show_thumbs'] = JHTML::_('select.booleanlist',  'show_thumbs', 'class="inputbox"', $profile->show_thumbs );

		$lists['crop_thumbs'] = JHTML::_('select.booleanlist',  'crop_thumbs', 'class="inputbox"', $profile->crop_thumbs );

		$thumb_position = array();
		$thumb_position[] = JHTML::_( 'select.option', 'left', JText::_( 'LEFT' ) );
		$thumb_position[] = JHTML::_( 'select.option', 'below', JText::_( 'BELOW' ) );
		$thumb_position[] = JHTML::_( 'select.option', 'right', JText::_( 'RIGHT' ) );
		$thumb_position[] = JHTML::_( 'select.option', 'above', JText::_( 'ABOVE' ) );
		$lists['thumb_position'] = JHTML::_('select.radiolist', $thumb_position, 'thumb_position', 'class="inputbox" ', 'value', 'text', $profile->thumb_position, 'thumb_position' );

		$lists['thumb_scrollbar'] = JHTML::_('select.booleanlist',  'thumb_scrollbar', 'class="inputbox"', $profile->thumb_scrollbar );

		$lists['arrows_up_down'] = JHTML::_('select.booleanlist',  'arrows_up_down', 'class="inputbox"', $profile->arrows_up_down );

		$lists['arrows_left_right'] = JHTML::_('select.booleanlist',  'arrows_left_right', 'class="inputbox"', $profile->arrows_left_right );
		
		$lists['thumb_pagination'] = JHTML::_('select.booleanlist', 'thumb_pagination', 'class="inputbox"', $profile->thumb_pagination );
		
		$thumb_pagination_amount = array();
		$thumb_pagination_amount[5] = JHTML::_( 'select.option', 5, 5 );
		$thumb_pagination_amount[10] = JHTML::_( 'select.option', 10, 10 );
		$thumb_pagination_amount[15] = JHTML::_( 'select.option', 15, 15 );
		$thumb_pagination_amount[20] = JHTML::_( 'select.option', 20, 20 );
		$thumb_pagination_amount[25] = JHTML::_( 'select.option', 25, 25 );
		$thumb_pagination_amount[30] = JHTML::_( 'select.option', 30, 30 );
		$thumb_pagination_amount[35] = JHTML::_( 'select.option', 35, 35 );
		$thumb_pagination_amount[40] = JHTML::_( 'select.option', 40, 40 );
		$thumb_pagination_amount[45] = JHTML::_( 'select.option', 45, 45 );
		$thumb_pagination_amount[50] = JHTML::_( 'select.option', 50, 50 );
		
		$lists['thumb_pagination_amount'] = JHTML::_('select.genericlist', $thumb_pagination_amount, 'thumb_pagination_amount', 'class="inputbox" size="1"', 'value', 'text', $profile->thumb_pagination_amount );


		//other tab
		$gallery_des_position = array();
		$gallery_des_position[] = JHTML::_( 'select.option', 'above', JText::_( 'ABOVE' ) );
		$gallery_des_position[] = JHTML::_( 'select.option', 'below', JText::_( 'BELOW' ) );
		$gallery_des_position[] = JHTML::_( 'select.option', 'none', JText::_( 'NONE' ) );
		$lists['gallery_des_position'] = JHTML::_('select.radiolist', $gallery_des_position, 'gallery_des_position', 'class="inputbox" ', 'value', 'text', $profile->gallery_des_position, 'gallery_des_position' );

		$styles = array();
		$styles['plain'] = JHTML::_( 'select.option', 'plain', JText::_( 'PLAIN' ) );
		$styles['grey-border-shadow'] = JHTML::_( 'select.option', 'grey-border-shadow', JText::_( 'GREY BORDER SHADOW' ) );
		$lists['style'] = JHTML::_('select.genericlist', $styles, 'style', 'class="inputbox" size="2"', 'value', 'text', $profile->style, '', 1 );

        $download_image = array();
		$download_image[] = JHTML::_( 'select.option', 'none', JText::_( 'NO DOWNLOAD' ) );
		$download_image[] = JHTML::_( 'select.option', 'large', JText::_( 'MAIN SIZE' ) );
		$download_image[] = JHTML::_( 'select.option', 'lightbox', JText::_( 'LIGHTBOX SIZE' ) );
		$download_image[] = JHTML::_( 'select.option', 'original', JText::_( 'ORIGINAL' ) );
		$lists['download_image'] = JHTML::_('select.radiolist', $download_image, 'download_image', 'class="inputbox" ', 'value', 'text', $profile->download_image, 'download_image' );
		
		$lists['show_tags'] = JHTML::_('select.booleanlist',  'show_tags', 'class="inputbox"', $profile->show_tags );
		
		$lists['report_image'] = JHTML::_('select.booleanlist',  'report_image', 'class="inputbox"', $profile->report_image );
		
		$lists['share_facebook'] = JHTML::_('select.booleanlist',  'share_facebook', 'class="inputbox"', $profile->share_facebook );
		
		$allow_comments = array();
		$allow_comments[] = JHTML::_( 'select.option', 0, JText::_( 'NONE' ) );
		$allow_comments[] = JHTML::_( 'select.option', 1, JText::_( 'IGNITE' ) );
		$allow_comments[] = JHTML::_( 'select.option', 2, JText::_( 'JCOMMENTS' ) );
		$allow_comments[] = JHTML::_( 'select.option', 3, JText::_( 'JOMCOMMENT' ) );
		
		$lists['allow_comments'] = JHTML::_('select.radiolist', $allow_comments, 'allow_comments', 'class="inputbox"', 'value', 'text', $profile->allow_comments, 'allow_comments' );
		
		$allow_rating = array();
		$allow_rating[] = JHTML::_( 'select.option', 0, JText::_( 'NONE' ) );
		$allow_rating[] = JHTML::_( 'select.option', 1, JText::_( 'IGNITE' ) );
		$allow_rating[] = JHTML::_( 'select.option', 2, JText::_( 'AL RATINGS' ) );
		
		$lists['allow_rating'] = JHTML::_('select.radiolist', $allow_rating, 'allow_rating', 'class="inputbox"', 'value', 'text', $profile->allow_rating, 'allow_rating' );

		$align = array();
		$align[] = JHTML::_( 'select.option', 'left', JText::_( 'LEFT' ) );
		$align[] = JHTML::_( 'select.option', 'center', JText::_( 'CENTER' ) );
		$align[] = JHTML::_( 'select.option', 'right', JText::_( 'RIGHT' ) );
		$lists['align'] = JHTML::_('select.radiolist', $align, 'align', 'class="inputbox" ', 'value', 'text', $profile->align, 'align' );

		$lists['show_slideshow_controls'] = JHTML::_('select.booleanlist',  'show_slideshow_controls', 'class="inputbox"', $profile->show_slideshow_controls );

		$lists['slideshow_autostart'] = JHTML::_('select.booleanlist',  'slideshow_autostart', 'class="inputbox"', $profile->slideshow_autostart );

		$lists['show_descriptions'] = JHTML::_('select.booleanlist',  'show_descriptions', 'class="inputbox"', $profile->show_descriptions );

		$photo_des_position = array();
		$photo_des_position[] = JHTML::_( 'select.option', 'left', JText::_( 'LEFT' ) );
		$photo_des_position[] = JHTML::_( 'select.option', 'below', JText::_( 'BELOW' ) );
		$photo_des_position[] = JHTML::_( 'select.option', 'right', JText::_( 'RIGHT' ) );
		$photo_des_position[] = JHTML::_( 'select.option', 'above', JText::_( 'ABOVE' ) );
		$lists['photo_des_position'] = JHTML::_('select.radiolist', $photo_des_position, 'photo_des_position', 'class="inputbox" ', 'value', 'text', $profile->photo_des_position, 'photo_des_position' );

		//lightbox tab
		$lists['lightbox'] = JHTML::_('select.booleanlist',  'lightbox', 'class="inputbox"', $profile->lightbox );

		$lists['crop_lbox'] = JHTML::_('select.booleanlist', 'crop_lbox', 'class="inputbox"', $profile->crop_lbox );

		$lists['lbox_preload'] = JHTML::_('select.booleanlist',  'lbox_preload', 'class="inputbox"', $profile->lbox_preload );


		//lightbox thumbs tab
		$lists['lbox_show_thumbs'] = JHTML::_('select.booleanlist',  'lbox_show_thumbs', 'class="inputbox"', $profile->lbox_show_thumbs );

		$lists['lbox_crop_thumbs'] = JHTML::_('select.booleanlist',  'lbox_crop_thumbs', 'class="inputbox"', $profile->lbox_crop_thumbs );

		$lbox_thumb_position = array();
		$lbox_thumb_position[] = JHTML::_( 'select.option', 'left', JText::_( 'LEFT' ) );
		$lbox_thumb_position[] = JHTML::_( 'select.option', 'below', JText::_( 'BELOW' ) );
		$lbox_thumb_position[] = JHTML::_( 'select.option', 'right', JText::_( 'RIGHT' ) );
		$lbox_thumb_position[] = JHTML::_( 'select.option', 'above', JText::_( 'ABOVE' ) );
		$lists['lbox_thumb_position'] = JHTML::_('select.radiolist', $lbox_thumb_position, 'lbox_thumb_position', 'class="inputbox" ', 'value', 'text', $profile->lbox_thumb_position, 'lbox_thumb_position' );

		$lists['lbox_thumb_scrollbar'] = JHTML::_('select.booleanlist',  'lbox_thumb_scrollbar', 'class="inputbox"', $profile->lbox_thumb_scrollbar );

		$lists['lbox_arrows_up_down'] = JHTML::_('select.booleanlist',  'lbox_arrows_up_down', 'class="inputbox"', $profile->lbox_arrows_up_down );

		$lists['lbox_arrows_left_right'] = JHTML::_('select.booleanlist',  'lbox_arrows_left_right', 'class="inputbox"', $profile->lbox_arrows_left_right );


		//lightbox other tab
		$lbox_allow_comments = array();
		$lbox_allow_comments[] = JHTML::_( 'select.option', 0, JText::_( 'NONE' ) );
		$lbox_allow_comments[] = JHTML::_( 'select.option', 1, JText::_( 'IGNITE' ) );
		$lbox_allow_comments[] = JHTML::_( 'select.option', 2, JText::_( 'JCOMMENTS' ) );
		$lbox_allow_comments[] = JHTML::_( 'select.option', 3, JText::_( 'JOMCOMMENT' ) );
		$lists['lbox_allow_comments'] = JHTML::_('select.radiolist', $lbox_allow_comments, 'lbox_allow_comments', 'class="inputbox"', 'value', 'text', $profile->lbox_allow_comments, 'lbox_allow_comments' );

		$lbox_allow_rating = array();
		$lbox_allow_rating[] = JHTML::_( 'select.option', 0, JText::_( 'NONE' ) );
		$lbox_allow_rating[] = JHTML::_( 'select.option', 1, JText::_( 'IGNITE' ) );
		$lbox_allow_rating[] = JHTML::_( 'select.option', 2, JText::_( 'AL RATINGS' ) );
		
		$lists['lbox_allow_rating'] = JHTML::_('select.radiolist', $lbox_allow_rating, 'lbox_allow_rating', 'class="inputbox"', 'value', 'text', $profile->lbox_allow_rating, 'lbox_allow_rating' );

		$lbox_close_position = array();
		$lbox_close_position[] = JHTML::_( 'select.option', 'below', JText::_( 'BELOW' ) );
		$lbox_close_position[] = JHTML::_( 'select.option', 'above', JText::_( 'ABOVE' ) );
		$lists['lbox_close_position'] = JHTML::_('select.radiolist', $lbox_close_position, 'lbox_close_position', 'class="inputbox" ', 'value', 'text', $profile->lbox_close_position, 'lbox_close_position' );
		
		$lists['lbox_scalable'] = JHTML::_('select.booleanlist',  'lbox_scalable', 'class="inputbox"', $profile->lbox_scalable );

		$lbox_download_image = array();
		$lbox_download_image[] = JHTML::_( 'select.option', 'none', JText::_( 'NO DOWNLOAD' ) );
		$lbox_download_image[] = JHTML::_( 'select.option', 'large', JText::_( 'MAIN SIZE' ) );
		$lbox_download_image[] = JHTML::_( 'select.option', 'lightbox', JText::_( 'LIGHTBOX SIZE' ) );
		$lbox_download_image[] = JHTML::_( 'select.option', 'original', JText::_( 'ORIGINAL' ) );
		$lists['lbox_download_image'] = JHTML::_('select.radiolist', $lbox_download_image, 'lbox_download_image', 'class="inputbox" ', 'value', 'text', $profile->lbox_download_image, 'lbox_download_image' );
		
		$lists['lbox_show_tags'] = JHTML::_('select.booleanlist',  'lbox_show_tags', 'class="inputbox"', $profile->lbox_show_tags );
		
		$lists['lbox_report_image'] = JHTML::_('select.booleanlist',  'lbox_report_image', 'class="inputbox"', $profile->lbox_report_image );
		
		$lists['lbox_share_facebook'] = JHTML::_('select.booleanlist',  'lbox_share_facebook', 'class="inputbox"', $profile->lbox_share_facebook );

		$lists['lbox_show_slideshow_controls'] = JHTML::_('select.booleanlist',  'lbox_show_slideshow_controls', 'class="inputbox"', $profile->lbox_show_slideshow_controls );

		$lists['lbox_slideshow_autostart'] = JHTML::_('select.booleanlist',  'lbox_slideshow_autostart', 'class="inputbox"', $profile->lbox_slideshow_autostart );

		$lists['lbox_show_descriptions'] = JHTML::_('select.booleanlist',  'lbox_show_descriptions', 'class="inputbox"', $profile->lbox_show_descriptions );

		$lbox_photo_des_position = array();
		$lbox_photo_des_position[] = JHTML::_( 'select.option', 'left', JText::_( 'LEFT' ) );
		$lbox_photo_des_position[] = JHTML::_( 'select.option', 'below', JText::_( 'BELOW' ) );
		$lbox_photo_des_position[] = JHTML::_( 'select.option', 'right', JText::_( 'RIGHT' ) );
		$lbox_photo_des_position[] = JHTML::_( 'select.option', 'above', JText::_( 'ABOVE' ) );
		$lists['lbox_photo_des_position'] = JHTML::_('select.radiolist', $lbox_photo_des_position, 'lbox_photo_des_position', 'class="inputbox" ', 'value', 'text', $profile->lbox_photo_des_position, 'lbox_photo_des_position' );

		//frontend acl tab
		$lists['acl_cat_menu'] 	 	 = igHtmlHelper::getACLSelect('acl_cat_menu', explode(',', $profile->acl_cat_menu), false );
		$lists['acl_cat_display'] 	 = igHtmlHelper::getACLSelect('acl_cat_display', explode(',', $profile->acl_cat_display), false );
		$lists['acl_cat_view'] 	     = igHtmlHelper::getACLSelect('acl_cat_view', explode(',', $profile->acl_cat_view) );
		$lists['acl_cat_edit'] 	     = igHtmlHelper::getACLSelect('acl_cat_edit', explode(',', $profile->acl_cat_edit) );
		$lists['acl_cat_delete'] 	 = igHtmlHelper::getACLSelect('acl_cat_delete', explode(',', $profile->acl_cat_delete) );
		$lists['acl_cat_publish'] 	 = igHtmlHelper::getACLSelect('acl_cat_publish', explode(',', $profile->acl_cat_publish) );
		$lists['acl_cat_order'] 	 = igHtmlHelper::getACLSelect('acl_cat_order', explode(',', $profile->acl_cat_order) );
		$lists['acl_upload'] 	     = igHtmlHelper::getACLSelect('acl_upload', explode(',', $profile->acl_upload) );
		$lists['acl_photo_view'] 	 = igHtmlHelper::getACLSelect('acl_photo_view', explode(',', $profile->acl_photo_view) );
		$lists['acl_photo_edit'] 	 = igHtmlHelper::getACLSelect('acl_photo_edit', explode(',', $profile->acl_photo_edit) );
		$lists['acl_photo_del'] 	 = igHtmlHelper::getACLSelect('acl_photo_del', explode(',', $profile->acl_photo_del) );
		$lists['acl_photo_publish']  = igHtmlHelper::getACLSelect('acl_photo_publish', explode(',', $profile->acl_photo_publish) );
		$lists['acl_photo_ordering'] = igHtmlHelper::getACLSelect('acl_photo_ordering', explode(',', $profile->acl_photo_ordering) );

		$this->assignRef('lists',   $lists);
		$this->assignRef('profile',	$profile);

		parent::display($tpl);
	}
}